package com.itheima.work1114;

import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) throws ParseException {
        Scanner sc = new Scanner(System.in);
        //获取输入日期
        System.out.println("请输入生日");
        String str = sc.nextLine();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        //获取当前时间
        Date nowDate = new Date();
        //解析为时间对象
        Date birthdate = sdf.parse(str);
        System.out.println(birthdate);
        //获取毫秒
        long bornTime = birthdate.getTime();
        long nowTime = nowDate.getTime();
        System.out.println("您当前已破壳" + (nowTime - bornTime) / 1000 / 60 / 60 / 24 + "天");


    }

}
